home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / comm / term / trms20e.lha / RexxFiles.lha / TerminusDemo.trx < prev   
Text File  |  1995-01-28  |  6KB  |  243 lines

  1. /* Test of AREXX interface to Terminus 2.0a */
  2. /* Original by Bill Hogsett. */
  3. /* Modified for 2.0c by Jack Radigan. */
  4.  
  5. options failat 10
  6. options results
  7. signal on error
  8.  
  9.    'tpen'
  10.    dtpen = tpen
  11.    'bpen'
  12.    dbpen = bpen
  13. top:
  14.    'cls'
  15.    'print local "Terminus ARexx demo menu"'
  16.    'print local "------------------------\n"'
  17.    'print local "1. Read-only variable tests."'
  18.    'print local "2. Read/write variable tests."'
  19.    'print local "3. INPUT, ASK, GETINT and GETSTRING tests."'
  20.    'print local "4. CLRRECT, CLRLINE GETLINE test."'
  21.    'print local "0. Exit\n"'
  22.  
  23.    'ask local "Select a menu option: "'
  24.  
  25.    select
  26.       when result = 1 then signal option1
  27.       when result = 2 then signal option2
  28.       when result = 3 then signal option3
  29.       when result = 4 then signal option4
  30.       when result = 0 then signal option0
  31.       otherwise 'print local "Invalid selection"'
  32.       end
  33.  
  34.    signal top
  35.  
  36. option1:
  37.    'cls'
  38.    'print local "CARRIER test.\n"'
  39.    'print local "   This test requires a modem connected and ready to accept commands.  It"'
  40.    'print local "will use the AT&C command to toggle the DCD line.\n"'
  41.    'send "at&c0\r"'
  42.    'wait "OK"'
  43.    'carrier'
  44.    online = result
  45.    if result = 1 then
  46.       result = true
  47.    else
  48.       result = false
  49.    'print local "CARRIER is:' result '"'
  50.    'send "at&c1\r"'
  51.    'wait "OK"'
  52.    online = result
  53.    if result = 1 then
  54.       result = true
  55.    else
  56.       result = false
  57.    'print local "CARRIER is:' result '"'
  58.    call getret
  59.  
  60.    'col'
  61.    ccol = result
  62.    'row'
  63.    crow = result
  64.    'print local "\n\nCurrent row: ' crow ' current column: ' ccol '"'
  65.  
  66.    'cols'
  67.    ccol = result
  68.    'rows'
  69.    crow = result
  70.    'ilace'
  71.    if result = 1 then  
  72.       lace = on
  73.    else 
  74.       lace = off
  75.    'colors'
  76.    ccolor = result
  77.    'print local "\nCurrent display is:  Interlace - ' lace ' rows: ' crow ' cols: ' ccol ' colors: ' ccolor '"'
  78.  
  79.    'fontname$'
  80.    name = result
  81.    'fontheight'
  82.    height = result
  83.    'print local "\nFont in use is: ' name ' height: ' height '"'
  84.  
  85.    'date$'
  86.    date = result
  87.    'time$'
  88.    time = result
  89.    'print local "\nDate: ' date ' time: ' time '"'
  90.    call getret
  91.    signal top
  92.  
  93. option2:
  94.    'cls'
  95.    'tpen'
  96.    tpenn = result
  97.    'bpen'
  98.    bpenn = result
  99.    'cpen'
  100.    cpenn = result
  101.    'print local "Text: ' tpenn ' Bgnd: ' bpenn ' Cursor: ' cpenn '"'
  102.    'tpen = 7'
  103.    'bpen = 6'
  104.    'print local " Pen change test "'
  105.    'tpen = ' tpenn
  106.    'bpen = ' bpenn
  107.    'print local " Pen restore test"'
  108.    call getret
  109.  
  110.    'cursor = off'
  111.    'print local "\nThe cursor should be off"'
  112.    call getret
  113.    'cursor = on'
  114.    'print local "\nThe cursor should be on"'
  115.    call getret
  116.  
  117.    'timer'
  118.    ttimer = result
  119.    'timer = 120'
  120.    'print local "\nTimer should be set to 2:00 minutes."'
  121.    call getret
  122.    'timer = ' ttimer
  123.    'print local "\nTimer should be reset to original value."'
  124.    call getret
  125.    signal top
  126.  
  127. option3:
  128.    'cls'
  129.    'input local "Enter a line of text: "'
  130.    'print local "Your response was: ' result '"'
  131.    'ask local "Press a key:"'
  132.    'print local "\nYour response was: ' result '"'
  133.    'getint "Enter a number", 5, 0, 10'
  134.    'print local "Your response was:' result'"'
  135.    'getstring "Enter a string", "Test"'
  136.    'print local "Your response was:' result'"'
  137.    call getret
  138.    signal top
  139.  
  140. option4:
  141.    'cls'
  142.    'print local "\n   The following demo will fill rows 10 through 22 with the letter E and"'
  143.    'print local "then clear a rectangle starting at position 11, 21 to 21, 58.\n"'
  144.    'move 9, 1'
  145.    'tpen = 2'
  146.    do i = 1 to 80 by 1
  147.       'print local ' i // 10';'
  148.       end
  149.  
  150.    'tpen = 3'
  151.    'print local'
  152.    'move 10, 1'
  153.    do i = 10 to 22 by 1
  154.       'move ' i ', 1'
  155.       'print local "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"'
  156.       end
  157.  
  158.    'tpen = ' dtpen
  159.    do i = 10 to 22 by 1
  160.       'move ' i ', 1'
  161.       'print local ' i ';'
  162.       end
  163.  
  164.    'print local'
  165.    'bpen = 3'
  166.    'clrrect 11, 21, 21, 58'
  167.    'bpen = ' dbpen
  168.    call getret
  169.  
  170.    'cls'
  171.    'print local "   The CLRLINE demo will print a line of E characters at row 4 and will clear"'
  172.    'print local "a 20 character section starting at column 40.\n"'
  173.    'move 6, 1'
  174.    do i = 1 to 80 by 1
  175.       'print local ' i // 10';'
  176.       end
  177.  
  178.    'move 7, 1'
  179.    'print local "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"'
  180.    'move 7, 40'
  181.    'bpen = 3'
  182.    'clrline 20'
  183.    'bpen = ' dbpen
  184.    'move 9, 1'
  185.    call getret
  186.  
  187.    'cls'
  188.    'print local "   The INVLINE demo will print a line of E characters at line 4 in inverse"'
  189.    'print local "colors then will reinvert a 20 character section starting at column 30.\n"'
  190.    'move 6, 1'
  191.  
  192.    do i = 1 to 80 by 1
  193.       'print local ' i // 10';'
  194.       end
  195.    'move 7, 1'
  196.    'tpen = 2'
  197.    'bpen = 3'
  198.    'print local "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"'
  199.    'tpen = 3'
  200.    'bpen = 2'
  201.    'move 7, 30'
  202.    'invline 20'
  203.    'move 9, 1'
  204.    'tpen = ' dtpen
  205.    'bpen = ' dbpen
  206.    call getret
  207.  
  208.    'cls'
  209.    'print local "   The GETLINE$() demo lists some sample files and then inverts the middle line."'
  210.    'print local "The same line will be printed below the list to indicate that the GETLINE$()"'
  211.    'print local "worked.\n"'
  212.    'move 8,1'
  213.    'print local "      FILENAME       DATE     SIZE"'
  214.    'print local "      ----------------------------"'
  215.    'print local "      test.LZH       1/2/89   72323"'
  216.    'print local "      PIC.ZIP        2/12/90  23232"'
  217.    'print local "      DOC.ARC        12/30/91 97687"'
  218.    'move 11, 1'
  219.    'invline'
  220.    'move 15, 1'
  221.    'getline$(11)'
  222.    'print local "'result'"'
  223.  
  224.    call getret
  225.    signal top
  226.  
  227. option0:
  228.    'cls'
  229.    'print local "Terminus ARexx demo finished.\n"'
  230.    exit
  231.  
  232. end
  233.  
  234. error:
  235.    'print local "Error detected!"'
  236.    exit
  237.  
  238. getret:
  239.    'ask local "\nPress any key to continue."'
  240.    'print local'
  241.    return
  242.  
  243.